package com.oms.constant;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * @Author zhanghailong
 * @Description TODO
 * @Date 18:54 2020/3/26
 */
public enum UserRoleEnum implements IEnum<Integer> {
    /**
     * 管理员
     */
    ADMIN( 1 ),
    /**
     * 商家
     */
    MERCHANT( 2 ),
    /**
     * 买手
     */
    BUYER( 3 ),
    /**
     * 推广员
     */
    BROADCASTERS( 4 ),
    /**
     * 游客
     */
    CUSTOMER( 5 );

    private Integer value;

    private UserRoleEnum(Integer value) {
        this.value = value;
    }

    @Override
    public Integer getValue() {
        return null;
    }

    @Override
    public String toString() {
        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
        for (StackTraceElement e : stackTrace) {
            if (e.getClassName().startsWith( "springfox" )) {
                return "可选值:ADMIN:管理端，MERCHANT:商家，BUYER:买手，BROADCASTERS:推广员";
            }
        }
        return super.toString();
    }
}
